<template>
  <avue-form ref="form" :option="option" v-model="form"> </avue-form>
</template>

<script>
import { taskOption } from '@/option/tenant/supplier/audit-template-form'
export default {
  name: 'Task',
  props: ['type', 'params'],
  data() {
    return {
      form: {},
      option: taskOption.call(this)
    }
  },
  mounted() {
    if (['edit', 'view'].includes(this.type)) return (this.form = this.params)
  },
  methods: {
    handleSave() {
      ['add'].includes(this.type) ? this.$emit('add', this.form) : this.$emit('edit', this.form)
      this.$emit('update:visible', false)
    }
  }
}
</script>

<style></style>
